//
//  HYDemoViewController.swift
//  weibo-dg
//
//  Created by 源 何 on 16/9/24.
//  Copyright © 2016年 何源. All rights reserved.
//

import UIKit

class HYDemoViewController: HYBaseViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        //设置标题
        title = "第 \(navigationController?.childViewControllers.count ?? 0)个"
    }
    
    func showNext() {
        let vc = HYDemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension HYDemoViewController {
    
    //重写父类方法
    override func setupUI() {
        
        super.setupUI()
        //设置右侧的控制器
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
    }
}


